/*
 * @Author: gaolulu 1402328525@qq.com
 * @Date: 2024-08-09 16:53:12
 * @LastEditors: gaolulu 1402328525@qq.com
 * @LastEditTime: 2024-08-09 17:14:55
 * @FilePath: \insurance_policy_inspect_h5\src\assets\js\interactive.js
 * @Description: 嵌入金事通页面，token过期时，跳转到金事通登录页面封装方法
 */



export function interactive(obj:any) {
    if(obj && obj.method){
        if(obj.method == 'pushBack'){
            sessionStorage.clear()
        }
    }
    if(navigator.userAgent.indexOf("JinShiTong_iOS")!== -1){
        window.webkit.messageHandlers.interactive.postMessage(obj);
    }else if(navigator.userAgent.indexOf("JinShiTong_Android") !== -1){
        // interactive 安卓端定义的类名  postMessage 安卓端定义的方法名
        window.interactive.postMessage(JSON.stringify(obj))
    }
}